package com.miracle9.game.service;

import com.miracle9.game.dao.DeviceInfoDao;
import com.miracle9.game.dao.GameLogsServiceDao;
import com.miracle9.game.dao.UserServiceDao;
import com.miracle9.game.entity.DeviceInfo;
import com.miracle9.game.entity.GameLogs;
import com.miracle9.game.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("xsManageService")
public class XsManageService extends BaseService{

    @Autowired
    private DeviceInfoDao deviceInfoDao;

    @Autowired
    private UserServiceDao userServiceDao;

    @Autowired
    private GameLogsServiceDao gameLogsServiceDao;

    public List<DeviceInfo> q_CreateSqlList(String hql, Object[] params){
        return deviceInfoDao.q_CreateSqlList(hql,params);
    }
    public User getUserById(int userId){
      return  (User) userServiceDao.getById(userId);
    }

    public void gameLogsSave(GameLogs gameLogs){
        gameLogsServiceDao.save(gameLogs);
    }
    public void updateGameById(int userId,int amount,int gameGold){
        userServiceDao.updateGameById(userId,amount,gameGold);
    }
}
